public class O06 {
    int[] re;
    int all,now;
    public int[] reversePrint(ListNode head) {
        all=0;
        now = 0;
        back(head);
        return re;
    }
    public void back(ListNode node){
        all++;
        if (node==null){
            re = new int[all-1];
            return;
        }
        int t = node.val;
        back(node.next);
        re[now] = t;
        now++;
    }

}
